//
//  GoodsCell.m
//  BigJoy
//
//  Created by Rowling on 2017/7/10.
//  Copyright © 2017年 Rowling. All rights reserved.
//

#import "GoodsCell.h"

@interface GoodsCell()

@property (weak, nonatomic) IBOutlet UILabel *countLable;
@property (nonatomic,assign) NSInteger count;
@end

@implementation GoodsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)setCount:(NSInteger)count {
    _count = count;
    self.countLable.text = [NSString stringWithFormat:@"%ld",count];
}

- (IBAction)deleteButtonClick:(id)sender {
    self.count --;
}


- (IBAction)addbuttonClick:(id)sender {
    self.count ++;
}

- (IBAction)xuanzhongButton:(UIButton *)sender {
    sender.selected = !sender.selected;
}

+(instancetype)cellWithTalbelView:(UITableView *)table {
    GoodsCell * cell = [table dequeueReusableCellWithIdentifier:@"GCell"];
    if (cell == nil) {
        cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].firstObject;
    }
    return cell;
}

@end
